<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>miniFOC: algorithm/filter.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="Acme_LOGO.png"/></td>
  <td id="projectalign">
   <div id="projectname">miniFOC<span id="projectnumber">&#160;1.0.3</span>
   </div>
   <div id="projectbrief">This open-source project aims to accomplish a FOC(Field Oriented Control) scheme that is operatable with minimum costs in China.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_99d3723365464dd656f512988bb8dbbd.html">algorithm</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle"><div class="title">filter.h</div></div>
</div><!--header-->
<div class="contents">
<a href="filter_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/**************************************************************************/</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="preprocessor">#ifndef MINIFOC_ALGORITHM_FILTER_H_</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#define MINIFOC_ALGORITHM_FILTER_H_</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span> </div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"><a class="line" href="struct_filter___structure__t.html">   16</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="struct_filter___structure__t.html#a95c29040dec4c9e97cf2f64cf4212435">   17</a></span>    <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_filter___structure__t.html#a95c29040dec4c9e97cf2f64cf4212435">coefficient1</a>;     </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"><a class="line" href="struct_filter___structure__t.html#a08c1824c5523caa58ec64b9fcfd48f92">   18</a></span>    <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_filter___structure__t.html#a08c1824c5523caa58ec64b9fcfd48f92">coefficient2</a>;     </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="struct_filter___structure__t.html#a72864a941ae97fcfd272e9493d6cb6c7">   19</a></span>    <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_filter___structure__t.html#a72864a941ae97fcfd272e9493d6cb6c7">last_result</a>;      </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"><a class="line" href="struct_filter___structure__t.html#a845b4ebfab6dc03b5babd7f9ff5e2b6c">   20</a></span>    <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_filter___structure__t.html#a845b4ebfab6dc03b5babd7f9ff5e2b6c">current_result</a>;   </div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span>} <a class="code hl_struct" href="struct_filter___structure__t.html">Filter_Structure_t</a>;</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="keyword">extern</span> <span class="keyword">volatile</span> <a class="code hl_struct" href="struct_filter___structure__t.html">Filter_Structure_t</a> <a class="code hl_variable" href="filter_8h.html#a70331d536c7d5e99a76bd8651fd6b714">velocity_filter</a>;</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="keywordtype">float</span> <a class="code hl_function" href="filter_8h.html#a687b2ec6984ce9fa9d08189a3e7e1592">filter_update_value</a>(<a class="code hl_struct" href="struct_filter___structure__t.html">Filter_Structure_t</a> *param, <span class="keywordtype">short</span> value);</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span><span class="keywordtype">void</span> <a class="code hl_function" href="filter_8h.html#aa1e7128fffcf2b56a6fb1c23f89afd75">filter_config</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span> </div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#endif </span><span class="comment">//MINIFOC_ALGORITHM_FILTER_H_</span></div>
<div class="ttc" id="afilter_8h_html_a687b2ec6984ce9fa9d08189a3e7e1592"><div class="ttname"><a href="filter_8h.html#a687b2ec6984ce9fa9d08189a3e7e1592">filter_update_value</a></div><div class="ttdeci">float filter_update_value(Filter_Structure_t *param, short value)</div><div class="ttdoc">update the output value of the first-order low-pass filter</div><div class="ttdef"><b>Definition:</b> <a href="filter_8c_source.html#l00056">filter.c:56</a></div></div>
<div class="ttc" id="afilter_8h_html_a70331d536c7d5e99a76bd8651fd6b714"><div class="ttname"><a href="filter_8h.html#a70331d536c7d5e99a76bd8651fd6b714">velocity_filter</a></div><div class="ttdeci">volatile Filter_Structure_t velocity_filter</div><div class="ttdoc">motor rotation speed low pass filter handle</div><div class="ttdef"><b>Definition:</b> <a href="filter_8c_source.html#l00019">filter.c:19</a></div></div>
<div class="ttc" id="afilter_8h_html_aa1e7128fffcf2b56a6fb1c23f89afd75"><div class="ttname"><a href="filter_8h.html#aa1e7128fffcf2b56a6fb1c23f89afd75">filter_config</a></div><div class="ttdeci">void filter_config(void)</div><div class="ttdoc">configure low-pass filter parameters</div><div class="ttdef"><b>Definition:</b> <a href="filter_8c_source.html#l00045">filter.c:45</a></div></div>
<div class="ttc" id="astruct_filter___structure__t_html"><div class="ttname"><a href="struct_filter___structure__t.html">Filter_Structure_t</a></div><div class="ttdoc">structure of low-pass filter algorithm</div><div class="ttdef"><b>Definition:</b> <a href="filter_8h_source.html#l00016">filter.h:16</a></div></div>
<div class="ttc" id="astruct_filter___structure__t_html_a08c1824c5523caa58ec64b9fcfd48f92"><div class="ttname"><a href="struct_filter___structure__t.html#a08c1824c5523caa58ec64b9fcfd48f92">Filter_Structure_t::coefficient2</a></div><div class="ttdeci">float coefficient2</div><div class="ttdoc">low-pass filter coefficient 2</div><div class="ttdef"><b>Definition:</b> <a href="filter_8h_source.html#l00018">filter.h:18</a></div></div>
<div class="ttc" id="astruct_filter___structure__t_html_a72864a941ae97fcfd272e9493d6cb6c7"><div class="ttname"><a href="struct_filter___structure__t.html#a72864a941ae97fcfd272e9493d6cb6c7">Filter_Structure_t::last_result</a></div><div class="ttdeci">float last_result</div><div class="ttdoc">previous calculation results of low-pass filter</div><div class="ttdef"><b>Definition:</b> <a href="filter_8h_source.html#l00019">filter.h:19</a></div></div>
<div class="ttc" id="astruct_filter___structure__t_html_a845b4ebfab6dc03b5babd7f9ff5e2b6c"><div class="ttname"><a href="struct_filter___structure__t.html#a845b4ebfab6dc03b5babd7f9ff5e2b6c">Filter_Structure_t::current_result</a></div><div class="ttdeci">float current_result</div><div class="ttdoc">current calculation results of low-pass filter</div><div class="ttdef"><b>Definition:</b> <a href="filter_8h_source.html#l00020">filter.h:20</a></div></div>
<div class="ttc" id="astruct_filter___structure__t_html_a95c29040dec4c9e97cf2f64cf4212435"><div class="ttname"><a href="struct_filter___structure__t.html#a95c29040dec4c9e97cf2f64cf4212435">Filter_Structure_t::coefficient1</a></div><div class="ttdeci">float coefficient1</div><div class="ttdoc">low-pass filter coefficient 1</div><div class="ttdef"><b>Definition:</b> <a href="filter_8h_source.html#l00017">filter.h:17</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
